FROM java:8
ADD file-server.jar app.jar
RUN bash -c 'touch /app.jar' && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
EXPOSE 8106
ENV JAVA_OPTS="\
-server \
-Xmx2048m \
-Xms2048m \
-Xmn1024m \
-XX:SurvivorRatio=8 \
-XX:MetaspaceSize=512m \
-XX:MaxMetaspaceSize=512m \
-XX:PretenureSizeThreshold=10m \
-XX:+UseConcMarkSweepGC \
-XX:MaxTenuringThreshold=4 \
-XX:+UseParNewGC \
-XX:+UseCMSCompactAtFullCollection \
-XX:CMSFullGCsBeforeCompaction=0 \
-XX:CMSInitiatingOccupancyFraction=92 \
-XX:+CMSScavengeBeforeRemark \
-Xloggc:/gc.log \
-XX:+UseGCLogFileRotation \
-XX:NumberOfGCLogFiles=5 \
-XX:GCLogFileSize=10M"
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /app.jar